<html>
<head><meta charset="utf-8"><title>Should we switch to the new rowan? · t-compiler/rust-analyzer · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/index.html">t-compiler/rust-analyzer</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Should.20we.20switch.20to.20the.20new.20rowan.3F.html">Should we switch to the new rowan?</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="227467274"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Should%20we%20switch%20to%20the%20new%20rowan%3F/near/227467274" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Should.20we.20switch.20to.20the.20new.20rowan.3F.html#227467274">(Feb 23 2021 at 17:13)</a>:</h4>
<p>Hey, the new rowan finally at the stage where we can meaningfully compare performance and API changes.</p>



<a name="227467344"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Should%20we%20switch%20to%20the%20new%20rowan%3F/near/227467344" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Should.20we.20switch.20to.20the.20new.20rowan.3F.html#227467344">(Feb 23 2021 at 17:14)</a>:</h4>
<p>Take a look at this PR: <a href="https://github.com/rust-analyzer/rust-analyzer/pull/7498">https://github.com/rust-analyzer/rust-analyzer/pull/7498</a></p>



<a name="227467575"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Should%20we%20switch%20to%20the%20new%20rowan%3F/near/227467575" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Should.20we.20switch.20to.20the.20new.20rowan.3F.html#227467575">(Feb 23 2021 at 17:15)</a>:</h4>
<p>I'd love to see some input from <span class="user-group-mention" data-user-group-id="1060">@WG-rls2.0</span> on whether we should or should not switch to it.</p>
<p>The main benefit is that the API for mutating trees is much better and composable. </p>
<p>The main drawback is that's not zero cost  -- even if you don't touch trees, there's still some fluff happening.</p>



<a name="227469036"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Should%20we%20switch%20to%20the%20new%20rowan%3F/near/227469036" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Should.20we.20switch.20to.20the.20new.20rowan.3F.html#227469036">(Feb 23 2021 at 17:25)</a>:</h4>
<p>What about the memory usage? It looks like <code>mallinfo</code> is overflowing again in your test. It goes from 392 MB to -1223 MB, which seems worse than slightly more memory.</p>



<a name="227469465"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Should%20we%20switch%20to%20the%20new%20rowan%3F/near/227469465" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Should.20we.20switch.20to.20the.20new.20rowan.3F.html#227469465">(Feb 23 2021 at 17:28)</a>:</h4>
<p>The slowdown (5.88s to 6.33s) seems quite reasonable to me. I think assists are quite popular, and might become even more so in the future, so it's not a bad idea to invest in the API.</p>



<a name="227470006"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Should%20we%20switch%20to%20the%20new%20rowan%3F/near/227470006" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jeremy Kolb <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Should.20we.20switch.20to.20the.20new.20rowan.3F.html#227470006">(Feb 23 2021 at 17:31)</a>:</h4>
<p>Agreed on both of those comment. The API improvements look really nice and should unlock some assists that would otherwise be a PITA to implement. The slowdown isn't terrible but the memory usage is concerning.</p>



<a name="227474984"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Should%20we%20switch%20to%20the%20new%20rowan%3F/near/227474984" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Should.20we.20switch.20to.20the.20new.20rowan.3F.html#227474984">(Feb 23 2021 at 18:01)</a>:</h4>
<p>urgh, I might have left some memory leaks in?</p>



<a name="227483099"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Should%20we%20switch%20to%20the%20new%20rowan%3F/near/227483099" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Should.20we.20switch.20to.20the.20new.20rowan.3F.html#227483099">(Feb 23 2021 at 18:49)</a>:</h4>
<p>updated the numbers: <a href="https://github.com/rust-analyzer/rust-analyzer/pull/7498#issuecomment-784359922">https://github.com/rust-analyzer/rust-analyzer/pull/7498#issuecomment-784359922</a></p>



<a name="227483348"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Should%20we%20switch%20to%20the%20new%20rowan%3F/near/227483348" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Should.20we.20switch.20to.20the.20new.20rowan.3F.html#227483348">(Feb 23 2021 at 18:51)</a>:</h4>
<p><em><code>malloc()</code> goes brr..</em> :D. That's quite an increase in memory usage</p>



<a name="227485298"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Should%20we%20switch%20to%20the%20new%20rowan%3F/near/227485298" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Should.20we.20switch.20to.20the.20new.20rowan.3F.html#227485298">(Feb 23 2021 at 19:02)</a>:</h4>
<p>Hm, I just realized a thing which makes me more optimistic about the idea.</p>
<p>The fundamental trick we employ here is using different representations for “mutable” and “immutable” trees. At the moment, the two reprs are quite similar, and differ only in the number of fields. </p>
<p>But it feels like explicit switch between mutable and immutable tree pages the way to introducing an array-based immutable impl</p>



<a name="227487100"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Should%20we%20switch%20to%20the%20new%20rowan%3F/near/227487100" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Should.20we.20switch.20to.20the.20new.20rowan.3F.html#227487100">(Feb 23 2021 at 19:14)</a>:</h4>
<p>That would be awesome</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>